﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Security.Cryptography;
using PlugNT.Safe;
using PlugNT.Custom;
using PlugNT.Cms.Model;

namespace PlugNT.Cms.BLL
{
    public class SysModel
    {

        private static readonly PlugNT.Cms.DAL.SysModel dal = new PlugNT.Cms.DAL.SysModel();


        public static int GetDictionaryCount()
        {
            return PlugNT.Cms.DAL.SysModel.GetDictionaryCount();
        }

        public static SysModelInfo GetSysModelInfoByIndex(int index)
        {
            return PlugNT.Cms.DAL.SysModel.GetSysModelInfoByIndex(index);
        }


        public static bool Exists(int id)
        {
            return PlugNT.Cms.DAL.SysModel.Exists(id);
        }

        public static SysModelInfo GetSysModelInfoFromDictionary(int id)
        {
            return PlugNT.Cms.DAL.SysModel.GetSysModelInfoFromDictionary(id);
        }

        public static SysModelInfo CreateSysModelInfo(int type)
        {
            return PlugNT.Cms.DAL.SysModel.CreateSysModelInfo(type);
        }



        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Add(SysModelInfo model)
        {
            return dal.Add(model);
        }

        /// <summary>
        /// 编辑
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Update(SysModelInfo model)
        {
            return dal.Update(model);
        }

        public bool UpdateVisitMax(int id, int visitMaxCount, DateTime visitMaxTime)
        {
             return dal.UpdateVisitMax(id,visitMaxCount,visitMaxTime);
        }

        //public bool UpdateArr(int id, string strArr)
        //{
        //    return dal.UpdateArr(id, strArr);
        //}


        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool Delete(int id)
        {
            return dal.Delete(id);
        }

        public DataTable GetList(string andWhere)
        {
            return PlugNT.Cms.DAL.SysModel.GetList(andWhere);
        }

    }
}
